﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Views/Admin.master" AutoEventWireup="true"
    CodeFile="product.aspx.cs" Inherits="Admin_product" %>

<%@ Register TagPrefix="tpxLogin" TagName="Login" Src="~/Admin/Views/common/login.ascx"
    runat="Server" %>
<%@ Register TagPrefix="tpxMenu" TagName="Menu" Src="~/Admin/Views/common/menu.ascx"
    runat="Server" %>
<%@ Register TagPrefix="tpxUser" TagName="User" Src="~/Admin/Views/module/managerUser.ascx"
    runat="Server" %>
<%@ Register TagPrefix="tpxHome" TagName="home" Src="~/Admin/Views/module/home.ascx"
    runat="Server" %>
<%@ Register TagPrefix="tpxProduct" TagName="product" Src="~/Admin/Views/module/Product.ascx"
    runat="Server" %>
<asp:Content ID="Content1" ContentPlaceHolderID="menu" runat="Server">
    <tpxMenu:Menu ID="Menu1" runat="Server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="home" runat="Server">
    <script src="Views/JavaScript/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="Views/JavaScript/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
    <style type="text/css">
        .style4
        {
            font-size: medium;
        }
        .style3
        {
            width: 153px;
        }
        .style2
        {
            width: 87px;
        }
        .style5
        {
            text-align: left;
        }
    </style>
    <script>

        function confirm_delete() {
            if (confirm("Are you sure you want to delete ?") == true)
                return true;
            else
                return false;
        }
    </script>
    <form id="form1" runat="server">
    <div class="box">
        <div class="left">
        </div>
        <div class="right">
        </div>
        <div class="heading">
            <h1>
                Management Product</h1>
        </div>
        <div class="content">
            <asp:DataList ID="dlProduct" runat="server" Width="946px" DataKeyField="product_id"
                OnEditCommand="dlProduct_EditCommand" OnItemDataBound="dlProduct_ItemDataBound"
                OnUpdateCommand="dlProduct_UpdateCommand" OnDeleteCommand="dlProduct_DeleteCommand">
                <EditItemTemplate>
                    <table style="width: 100%;">
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label1" runat="server" Text="Name Product :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtNameProduct" runat="server" Text='<%# Bind("product_name") %>'></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label2" runat="server" Text="Description :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("product_des") %>'
                                    Height="73px" TextMode="MultiLine" Width="278px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label3" runat="server" Text="Quantity :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("product_quantity") %>'></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label4" runat="server" Text="Unit ID : "></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:DropDownList ID="drlUnitID" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label5" runat="server" Text="Image :"></asp:Label>
                            </td>
                            <td class="style5" align="justify" valign="middle">
                                <asp:Image ID="Image" runat="server" Height="92px" Width="115px" ImageUrl='<%# Eval("image") %>' />
                                &nbsp;<asp:FileUpload ID="fileUpload1" runat="server" />
                                <br />
                                <asp:Label ID="lblFileInfo" runat="server" Text='<%# Eval("image") %>'></asp:Label>
                                <br />
                                <asp:Button ID="Button6" runat="server" OnClick="Button6_Click" Text="Upload" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label6" runat="server" Text="ManuFacturer :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:DropDownList ID="drlManuFac" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label7" runat="server" Text="Price :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtPrice" runat="server" Text='<%# Eval("price") %>'></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label8" runat="server" Text="Date Add :"></asp:Label>
                            </td>
                            <td class="style5">
                                <script type="text/javascript">
                                    $(function () {
                                        $("#date_added").datepicker();
                                    });
                                </script>
                                <%--  <asp:TextBox ID="txtDateModified" runat="server" 
                                Text='<%# Eval("date_modified") %>'></asp:TextBox>--%>
                                <div class="demo">
                                    <input id="date_added" type="text" name="date_added" value='<%# Eval("date_added") %>'>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label9" runat="server" Text="Date Modified:"></asp:Label>
                            </td>
                            <td class="style5" id="demo-frame">
                                <asp:TextBox ID="txtDateModified" runat="server" Text='<%# Eval("date_modified") %>'
                                    Enabled="False"></asp:TextBox>
                                <%--  <div class="demo">
                                   
                                    <input id="date_modified" name="date_modified" type="text" value='<%# Eval("date_modified") %>'>
                            </div>--%>
                                <!-- End demo -->
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label10" runat="server" Text="Viewed :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtView" runat="server" Text='<%# Eval("viewed") %>'></asp:TextBox>
                                <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Style="margin-top: 0px"
                                    Text="Reset " Width="54px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label11" runat="server" Text="Sort Order :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtOrder" runat="server" Text='<%# Eval("sort_order") %>'></asp:TextBox>
                                <asp:Button ID="Button5" runat="server" OnClick="Button5_Click" Text="Reset" Width="54px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label12" runat="server" Text="Status :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:CheckBox ID="cbcStatus" runat="server" Checked='<%# Eval("status") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="Button1" runat="server" Text="Save" CommandName="Update" />
                                &nbsp;<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Cancel" />
                            </td>
                        </tr>
                    </table>
                </EditItemTemplate>
                <HeaderTemplate>
                    <table style="width: 100%;" align="center" border="1px solid black" cellpadding="0"
                        cellspacing="0">
                        <tr>
                            <th align="center" class="style3">
                                Action
                            </th>
                            <th align="center">
                                Product Name
                            </th>
                            <th align="center">
                                Quantity
                            </th>
                            <th align="center" class="style2">
                                ManuFacturer
                            </th>
                            <th align="center">
                                Price
                            </th>
                            <th align="center">
                                Status
                            </th>
                            <th align="center">
                                Date Add
                            </th>
                            <th align="center">
                                Viewed
                            </th>
                            <th align="center">
                                Sort Order
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td style="text-align: center">
                            <asp:ImageButton AlternateText="Edit" ImageUrl="~/image/Edit.gif" ID="EditLinkButton"
                                CommandName="Edit" Text="Edit" runat="server" />&nbsp;
                            <asp:ImageButton AlternateText="Delete" ImageUrl="~/image/Delete.gif" ID="DeleteLinkButton"
                                CommandName="Delete" Text="Delete" runat="server" OnClientClick="return confirm_delete();" />
                        </td>
                        <td style="text-align: center">
                            <%# Eval("product_name")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("product_quantity")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("manufacturer_id")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("price")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("status")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("date_added")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("viewed")%>
                        </td>
                        <td style="text-align: center">
                            <%# Eval("sort_order")%>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:DataList>
            </table> 
        </div>
    </div>
    </form>
</asp:Content>
